<template>
  <div>
      <md-serch-location @onSearch="setLocation">
          <md-map @onMoveEnd="moveEnd" />
          <div class="pois-list">
              <ul>
                  <li v-for="(item,index) in poisList" :key="index">
                      {{item.name}}
                      <p>{{item.address}}</p>
                  </li>
              </ul>
          </div>
      </md-serch-location>
  </div>
</template>

<script>
import storage from "@/utils/storage";
export default {
    name:'MapLoaction',
    data() {
        return {
            poisList:[]
        }
    },
    methods:{
        setLocation(location){
           const addressForm =storage.getItem('addressForm')
           addressForm.location=location
           storage.setItem('addressForm')
           this.$root.$emit('selectLocation',location)
           this.$router.back()
       },
        moveEnd (pois){
            this.poisList=pois
        }
    }
}
</script>

<style lang="scss" scoped>
.pois-list{
    @include wh(100vw,calc(100vh-98-400))
}
</style>